package com.xbongbong.parent.es;

import com.xbongbong.paas.enums.IndexTypeEnum;
import com.xbongbong.paas.pojo.dto.PaasFormDataEsInitDTO;
import com.xbongbong.paas.pojo.vo.PaasFormDataEsInitVO;
import com.xbongbong.paas.toolbox.exception.XbbException;

/**
 * ElasticSearch 初始化相关接口
 * @author zheng.li
 */
public interface PaasElasticSearchInitInterface {

    /**
     * 根据businessType同步业务数据到es
     * @param paasFormDataEsInitDTO 入参
     * @return PaasFormDataEsInitVO 返回参数
     * @throws XbbException 系统异常
     */
    PaasFormDataEsInitVO initAllByBuss(PaasFormDataEsInitDTO paasFormDataEsInitDTO) throws XbbException;

    /**
     * 按索引类型同步数据到es
     * @param paasFormDataEsInitDTO 入参
     * @param value 索引类型
     */
    void doInit(PaasFormDataEsInitDTO paasFormDataEsInitDTO, IndexTypeEnum value);

    /**
     * 同步子表单数据到es
     * @param paasFormDataEsInitDTO 入参
     * @return PaasFormDataEsInitVO 返回参数
     * @throws Exception 异常
     */
    PaasFormDataEsInitVO initSubData(PaasFormDataEsInitDTO paasFormDataEsInitDTO) throws Exception;

    /**
     * 同步主表数据到es
     * <p>单个索引初始化支持别名（2020-04-21）</p>
     * @param paasFormDataEsInitDTO 入参
     * @return PaasFormDataEsInitVO 返回参数
     * @throws XbbException 系统异常
     */
    PaasFormDataEsInitVO init(PaasFormDataEsInitDTO paasFormDataEsInitDTO) throws XbbException;



}
